<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The Yaf_Registry class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="yaf-plugin-abstract.routerstartup.html">Yaf_Plugin_Abstract::routerStartup</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="yaf-registry.clone.html">Yaf_Registry::__clone</a></div>
 <div class="up"><a href="book.yaf.html">Yaf</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.yaf-registry" class="reference">

 <h1 class="title">The Yaf_Registry class</h1>
 

 <div class="partintro"><p class="verinfo">(Yaf &gt;=1.0.0)</p>


  <div class="section" id="yaf-registry.intro">
   <h2 class="title">简介</h2>
   <p class="para">
     <strong class="classname">Yaf_Registry</strong>, 对象注册表(或称对象仓库)是一个用于在整个应用空间(application space)内存储对象和值的容器. 通过把对象存储在其中,我们可以在整个项目的任何地方使用同一个对象.这种机制相当于一种全局存储. 我们可以通过<strong class="classname">Yaf_Registry</strong>类的静态方法来使用对象注册表. 另外,由于该类是一个数组对象,你可以使用数组形式来访问其中的类方法
   </p>
  </div>


  <div class="section" id="yaf-registry.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">Yaf_Registry</strong>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 属性 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">static</span>
      <var class="varname"><a href="class.yaf-registry.html#yaf-registry.props.instance">$<var class="varname">_instance</var></a></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">protected</span>
      <var class="varname"><a href="class.yaf-registry.html#yaf-registry.props.entries">$<var class="varname">_entries</var></a></var>
    ;</div>


    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">private</span> <span class="type">void</span><span class="methodname"><a href="yaf-registry.clone.html" class="methodname">__clone</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="methodname"><a href="yaf-registry.construct.html" class="methodname">__construct</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">void</span><span class="methodname"><a href="yaf-registry.del.html" class="methodname">del</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">mixed</span><span class="methodname"><a href="yaf-registry.get.html" class="methodname">get</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">bool</span><span class="methodname"><a href="yaf-registry.has.html" class="methodname">has</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">bool</span><span class="methodname"><a href="yaf-registry.set.html" class="methodname">set</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$value</code></span>
   )</div>

   }</div>


  </div>

  

  <div class="section" id="yaf-registry.props">
   <h2 class="title">属性</h2>
   <dl>

    
     <dt id="yaf-registry.props.instance"><var class="varname"><var class="varname">_instance</var></var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
    
     <dt id="yaf-registry.props.entries"><var class="varname"><var class="varname">_entries</var></var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
   </dl>

  </div>



 </div>

 











































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="yaf-registry.clone.html">Yaf_Registry::__clone</a> — The __clone purpose</li><li><a href="yaf-registry.construct.html">Yaf_Registry::__construct</a> — Yaf_Registry implements singleton</li><li><a href="yaf-registry.del.html">Yaf_Registry::del</a> — Remove an item from registry</li><li><a href="yaf-registry.get.html">Yaf_Registry::get</a> — Retrieve an item from registry</li><li><a href="yaf-registry.has.html">Yaf_Registry::has</a> — Check whether an item exists</li><li><a href="yaf-registry.set.html">Yaf_Registry::set</a> — Add an item into registry</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="yaf-plugin-abstract.routerstartup.html">Yaf_Plugin_Abstract::routerStartup</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="yaf-registry.clone.html">Yaf_Registry::__clone</a></div>
 <div class="up"><a href="book.yaf.html">Yaf</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
